package com.micro.frog.fortune.api.impl;

import com.micro.frog.fortune.api.CwlController;
import com.micro.frog.fortune.executor.cwl.CwlAnalyExecutor;
import com.micro.frog.fortune.executor.cwl.CwlRecordExecutor;
import com.micro.frog.fortune.executor.cwl.CwlReportExecutor;
import com.micro.frog.fortune.executor.cwl.CwlSyncExecutor;
import com.micro.frog.fortune.model.base.PageResp;
import com.micro.frog.fortune.model.base.Resp;
import com.micro.frog.fortune.model.cwl.CwlRecordReq;
import com.micro.frog.fortune.model.cwl.CwlRecordResp;
import com.micro.frog.fortune.model.cwl.CwlReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Jason.lv
 * @since 2022/2/22 15:25
 */
@RestController
public class CwlControllerImpl implements CwlController {

  @Autowired
  private CwlRecordExecutor listExecutor;
  @Autowired
  private CwlSyncExecutor syncExecutor;
  @Autowired
  private CwlAnalyExecutor analyExecutor;
  @Autowired
  private CwlReportExecutor reportExecutor;

  @Override
  public PageResp<CwlRecordResp> list(CwlRecordReq req) {
    return listExecutor.execute(req);
  }

  @Override
  public Resp sync(CwlRecordReq req) {
    return syncExecutor.execute(req);
  }

  @Override
  public Resp analy(CwlReq req) {
    return analyExecutor.execute(req);
  }

  @Override
  public Resp report(CwlReq req) {
    return reportExecutor.execute(req);
  }
}
